<style>
    body {
        background-color: #FAFBFB;
    }
</style>
<div class="rc-pagepadding ">
    <div class=" rc-pannel rc-pagepadding">
        <div class="rc-pannel-body layui-form ">
            <form class="layui-form">
                <div class="layui-form-item">
                    <label class="layui-form-label element_title">栏目：</label>
                    <div class="layui-input-block" style="line-height: 30px;">

                        <input type="hidden" name="contentids" id="contentids" autocomplete="off" value="<?php echo request()->get('contentids') ?>" lay-verify="required" class="layui-input" />
                        <input type="text" name="tocid" id="tocid" autocomplete="off" value="0" lay-verify="required" class="layui-input" title="" />
                        <input type="hidden" name="fromcid" id="fromcid" autocomplete="off" value="<?php echo request()->get('fromcid') ?>" lay-verify="required" class="layui-input" title="" />
                    </div>

                </div>

                <div class="layui-form-item rc-margin-bottom0">
                    <div class="layui-input-block">
                        <button type="button" class="layui-btn layui-btn-primary layui-btn-sm" lay-submit lay-filter="submit">确定</button>
                        <button type="reset" class="layui-btn layui-btn-sm">重置</button>
                    </div>
                </div>
            </form>

        </div>


    </div>


</div>

<script src="/static/admin/lib/layui/modules/cascader/cascader.js"></script>
<link href="/static/admin/lib/layui/modules/cascader/cascader.css" rel="stylesheet">
<script>
    layui.use(function() {
        var form = layui.form;
        var layCascader = layui.layCascader;
        var el_cascaderdata = '<?php echo $tocates ?>';
        var el_cascaderdata_obj = $.parseJSON(el_cascaderdata);


        var el_cascader_ = layCascader({
            elem: '#tocid',
            filterable: true,
            options: el_cascaderdata_obj,
            props: {
                value: 'id',
                label: 'title',
                checkStrictly: true,
            }
        });


        form.on('submit(submit)', function(data) {
            $.ajax({
                url: '/app/cms/admin/Index/moveCate', //请求路径
                type: "POST", //请求方式
                data: data.field, // 默认写法
                success: function(data) {
                    if (data.code == 0) {
                        toastr_success("移动成功", function() {
                            window.parent.location.reload();
                        });
                    } else {
                        toastr_error(data.message);
                    }
                },
                error: function() {

                },

            });
        });




    });
</script>